<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:form id="frmTitle">
        <p:growl id="msgs" showDetail="false"/>
        <h:panelGrid columns="2" cellpadding="1">
            <h:outputText value="#{msgs.funcionarioTitulo}" styleClass="fontTitle"/>
        </h:panelGrid>
    </h:form>

    <h:form id="frmNew">

        <p:fieldset legend="#{msgs.funcionarioLgdNovo}">

            <h:panelGrid columns="2" id="pngNew">            

                <p:outputLabel for="lblnome" value="#{msgs.nome}"/>
                <h:panelGrid columns="2">     
                    <p:inputText id="lblnome" value="#{funcionarioEditMB.nome}" required="true" size="45"/>
                </h:panelGrid>
                
                <p:outputLabel for="lblLogin" value="#{msgs.login}"/>
                <h:panelGrid columns="2">     
                    <p:inputText id="lblLogin" value="#{funcionarioEditMB.login}" required="true" size="45"/>
                </h:panelGrid>
                
                <p:outputLabel for="lblSenha" value="#{msgs.senha}"/>
                <h:panelGrid columns="2">     
                    <p:password id="lblSenha" value="#{funcionarioEditMB.senha}" weakLabel="#{msgs.msmWeekLabel}" goodLabel="#{msgs.msmGoodLabel}" strongLabel="#{msgs.msmStrongLabel}" feedback="true"/>
                </h:panelGrid>

                <p:outputLabel for="lblemail" value="#{msgs.email}"/>
                <h:panelGrid columns="2">     
                    <p:inputText id="lblemail" value="#{funcionarioEditMB.email}" required="true" size="45"/>
                </h:panelGrid>
                
                <p:outputLabel for="lblDepartamento" value="#{msgs.lblDepartamentoResponsavel}"/>
                <h:panelGrid columns="2">
                    <p:selectOneMenu id="lblDepartamento" binding="#{funcionarioEditMB.cmbDepartamento}" value="#{funcionarioEditMB.iddepartamento}" style="width: 150px">  
                        <f:selectItem itemValue="0" itemLabel="#{msgs.cmbSelecione}" />
                        <f:selectItems value="#{funcionarioEditMB.lsdepartamento}"/>
                        <p:ajax listener="#{funcionarioEditMB.selecionarDepartamento}"/>  
                    </p:selectOneMenu>    
                </h:panelGrid>
                
                <p:outputLabel for="lblcargo" value="#{msgs.cargo}"/>
                <h:panelGrid columns="2">     
                    <p:inputText id="lblcargo" value="#{funcionarioEditMB.cargo}" required="true" size="45"/>
                </h:panelGrid>
                
                <p:outputLabel for="lblRg" value="#{msgs.rg}"/>
                <h:panelGrid columns="2">     
                    <p:inputMask id="lblRg" value="#{funcionarioEditMB.rg}" required="true" mask="99.999.999-9" size="14"/>
                </h:panelGrid>
                
                <p:outputLabel for="lblCpf" value="#{msgs.cpf}"/>
                <h:panelGrid columns="2">     
                    <p:inputMask id="lblCpf" value="#{funcionarioEditMB.cpf}" required="true" mask="999.999.999-99" size="14"/>
                </h:panelGrid>
                
                <p:outputLabel for="lbltelefone" value="#{msgs.telefone}"/>
                <h:panelGrid columns="2">     
                    <p:inputMask id="lbltelefone" value="#{funcionarioEditMB.telefone}" mask="(99)9999-9999" size="14"/>
                </h:panelGrid>
                
                <p:outputLabel for="lblcelular" value="#{msgs.celular}"/>
                <h:panelGrid columns="2">     
                    <p:inputMask id="lblcelular" value="#{funcionarioEditMB.celular}" mask="(99)9999-9999" size="14"/>
                </h:panelGrid>
                
                <p:outputLabel for="lblStatus" value="#{msgs.status}"/>
                <h:panelGrid columns="2">
                    <p:selectOneMenu id="lblStatus" binding="#{funcionarioEditMB.cmbStatus}" value="#{funcionarioEditMB.idstatus}">  
                        <f:selectItem itemValue="0" itemLabel="#{msgs.cmbSelecione}" />
                        <f:selectItems value="#{funcionarioEditMB.lsstatus}"/> 
                    </p:selectOneMenu>   
                </h:panelGrid>

                <h:panelGrid columns="2">
                    <p:commandButton id="btnSalvar" value="#{msgs.salvar}" action="#{funcionarioEditMB.salvar}" ajax="false"/>
                    <p:commandButton id="btnVoltar" value="#{msgs.voltar}" action="#{funcionarioEditMB.voltar}" ajax="false"/> 
                </h:panelGrid>
            </h:panelGrid>
    
        </p:fieldset>
    </h:form>
    
</html>

